package com.boomsecret.pattern.singleton;

/**
 * Created by wangjinliang on 2018/1/17.
 */
public class HungerSingletonPattern {

    private static HungerSingletonPattern instance = null;

    public static HungerSingletonPattern getInstance() {
        synchronized (HungerSingletonPattern.class) {
            if (instance == null) {
                instance = new HungerSingletonPattern();
            }
        }
        return instance;
    }

    public void invokeMethod() {
        System.out.println("LazySingletonPattern invokeMethod");
    }
}
